package com.easyj.base.security.service;

import org.springframework.security.core.context.SecurityContextHolder;
import com.easyj.base.security.SimpleUser;


public class SecurityUtil {
	
	
    /**
     * 当前操作人员ID
     * @return
     */
	public static Long getOperatorId(){
		SimpleUser p=(SimpleUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
		return p.getId();
	}
	
	
	
	
    /**
     * 当前操作人员
     * @return
     */
	public static SimpleUser getOperator(){
		SimpleUser p=(SimpleUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
		return p;
	}	
	
	
	
	
}
